    #include "node.h"

node::node()
{
    setBoundaryCondition(0,0,0,0,0.0,0.0,0.0,0.0);
    setGlobalMatrixNumerationX(0);
    setGlobalMatrixNumerationY(0);

    horizontalDeslocation = verticalDeslocation = 0.0;
}

void node::setGlobalNumeration(int num)
{
    globalNumeration = num;
}

void node::setPositionXY(float x, float y)
{
    positionX = x;
    positionY = y;
}

int node::getGlobalNumeration()
{
   return globalNumeration;
}

float node::getPositionX()
{
   return positionX;
}

float node::getPositionY()
{
   return positionY;
}

void node::setBoundaryCondition(int a, int b, int c, int d, float c1P, float c2P, float c1T, float c2T)
{
    boundaryCondition.zeros(2,4);
    boundaryCondition(0,0) = a;
    boundaryCondition(0,1) = b;
    boundaryCondition(0,2) = c;
    boundaryCondition(0,3) = d;
    boundaryCondition(1,0) = c1P;
    boundaryCondition(1,1) = c2P;
    boundaryCondition(1,2) = c1T;
    boundaryCondition(1,3) = c2T;
}

mat node::getBoundaryCondition()
{
    return boundaryCondition;
}

void node::setGlobalMatrixNumerationX(int a)
{
    globalMatrixNumerationX = a;
}

void node::setGlobalMatrixNumerationY(int a)
{
    globalMatrixNumerationY = a;
}

int node::getGlobalMatrixNumerationX()
{
    return globalMatrixNumerationX;
}

int node::getGlobalMatrixNumerationY()
{
    return globalMatrixNumerationY;
}

void node::setHorizontalDeslocation(float num)
{
    horizontalDeslocation = num;
}

void node::setVerticalDeslocation(float num)
{
    verticalDeslocation = num;
}

float node::getHorizontalDeslocation()
{
    return horizontalDeslocation;
}

float node::getVerticalDeslocation()
{
    return verticalDeslocation;
}

void node::setDeformation(mat aux)
{
    deformation += aux;
}

mat node::getDeformation()
{
    return deformation;
}

void node::setDeformationAnal(mat aux)
{
    deformationAnal += aux;
}

mat node::getDeformationAnal()
{
    return deformationAnal;
}


QDebug operator<<(QDebug x,node n)
{
    x.nospace() << n.getGlobalNumeration() << "(" << n.getPositionX() << "," <<n.getPositionY() << ");";
    return x.space();
}

QDebug operator<<(QDebug x,mat n)
{

    for(int i = 0 ; i < n.n_rows;i++)
    {
        for(int j = 0; j <n.n_cols; j++)
        {
            x.nospace() << n(i,j) << "   ";
        }
        x.nospace() << "\n";
    }
    return x.space();
}






